package com.hnust.service.impl;

import com.hnust.api.PaperCorreApi;
import com.hnust.api.ReviewPaperApi;
import com.hnust.api.getAnswer_testApi;
import com.hnust.domain.*;
import com.hnust.service.GetStuObjectiveQueMsgServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import retrofit2.Callback;

@Service("GetStuObjectiveQueMsgServices")
public class GetStuObjectiveQueMsgServicesImpl implements GetStuObjectiveQueMsgServices {
    @Autowired
    private ReviewPaperApi reviewPaperApi;
    @Autowired
    private getAnswer_testApi getAnswer_testApi;
    @Autowired
    private PaperCorreApi paperCorreApi;

    @Override
    public Result<StudentAnswerPartDto> getStudentAnswerPartDto(String testid, String paperid, String studentid) {
        return reviewPaperApi.getStudentAnswerPartDto(testid, paperid, studentid);
    }

    @Override
    public Result<PaperAnswerPartDto> getPaperAnswerPartDto(String paperid) {
        return reviewPaperApi.getPaperAnswerPartDto(paperid);
    }

    @Override
    public Result<JudgeAnswerPartDto> getJudgeAnswerPartDto(String testid, String paperid, String studentid) {
        return reviewPaperApi.getAllQuestionMessage(testid, paperid, studentid);
    }

    @Override
    public Result<QuestionAnswer> getQueDetailMsg(String testId, String questionId, String studentId, String questionType, String number) {
        return getAnswer_testApi.getQueDetailMsg(testId, questionId, studentId, questionType, number);
    }
    @Override
    public void changeScore(Callback<Result<Boolean>> callback, ChangeRequest changeRequest) {
        paperCorreApi.changeScore(changeRequest).enqueue(callback);
    }

    @Override
    public void changeStuTestStatus(Callback<Result<Boolean>> callback, String testId, String studentId) {
        paperCorreApi.changeStuTestStatus(testId,studentId).enqueue(callback);
    }

    @Override
    public void changeTeacherTestStatus(Callback<Result<Boolean>> callback, String testId, String teacherId) {
        paperCorreApi.changeTeacherTestStatus(testId, teacherId).enqueue(callback);
    }

    @Override
    public Result<Object> addAnnotation(String studentId, String testId, String questionId, String annoation) {
        return getAnswer_testApi.addAnnotation(studentId, testId, questionId, annoation);
    }



}
